package wudl.bigdata.db.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wudl.bigdata.db.bean.HiveTableBean;
import wudl.bigdata.db.mapper.HiveTableMapper;
import wudl.bigdata.db.service.HiveTableService;

import java.util.List;
import java.util.Map;


/**
 * @Author: wudl
 * @Description:
 * @ClassName: HiveServiceImpl
 * @Date: 2023/5/28 16:23
 */
@Service
public class HiveTableServiceImpl implements HiveTableService {

    @Autowired
    HiveTableMapper  hiveTableMapper;
    @Override
    public List<String> tableList() {

        String sql = "SHOW TABLES IN db_hive";
        List<String> user = hiveTableMapper.tableList(sql);
        return user;
    }

    @Override
    public List<String> PosttableList(HiveTableBean hiveTableBean) {
        List<String> user = hiveTableMapper.tableList(hiveTableBean.getHiveSql());
        return user;
    }

    @Override
    public List<Map<String, Object>> getPostListMap(HiveTableBean hiveTableBean) {

        List<Map<String, Object>> listMap = hiveTableMapper.getListMap(hiveTableBean.getHiveSql());
        return listMap;
    }
}
